using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using Sagile.Nepma;

namespace Sagile.Nepma.Test
{
    /// <summary>
    /// Dummy task 3
    /// </summary>
    public class Task3 : TaskBase
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Task3"/> class.
        /// </summary>
        public Task3() : base("Task3", false, false, 1)
        {
            Console.WriteLine(this);
            Id = "0207FC79-7448-4cab-A369-ED5D7E6C177E";
        }

        /// <summary>
        /// Method called by the worker thread. Finished event is called at the end of the method.
        /// </summary>
        protected override void Process()
        {
            for (double i = 0; i < 100; i += 1.0)
            {
                OnTaskProgressChanged(i);
                Thread.Sleep(50);
            }

            throw new NullReferenceException();

            base.Process();
        }
    }
}
